Fish biodiversity in Marine World Heritage Sites

This notebook explores fish diversity in Marine World Heritage Sites using OBIS data.

Fish species in WoRMS

[todo]

Fish data in OBIS

library(robis)
library(knitr)

if (!file.exists("checklist.Rdata")) {
  cl <- checklist(dropped = "include")
  cl <- cl %>%
    mutate(species_fish = ifelse(superclass == "Pisces", species, NA)) %>%
    mutate(species_vulnerable = ifelse(category %in% c("VU", "EN", "CR"), species, NA)) %>%
    mutate(species_vulnerable_fish = ifelse(superclass == "Pisces" & category %in% c("VU", "EN", "CR"), species, NA))
  save(cl, file = "checklist.Rdata")
} else {
  load("checklist.Rdata")
}

cl %>%
  summarize(
    records = sum(records),
    species = length(unique(species)),
    fish = length(unique(species_fish)),
    vulnerable = length(unique(species_vulnerable)),
    vulnerable_fish = length(unique(species_vulnerable_fish))
  ) %>%
  kable(format.args = list(big.mark = ","))
records species fish vulnerable vulnerable_fish
76,542,439 153,438 24,523 1,910 1,008

Fish data for the Marine World Heritage Sites

Fetch spatial data

First fetch the Marine World Heritage Sites shapefile from MarineRegions:

library(sf)
library(dplyr)

if (!file.exists("shape/worldheritagemarineprogramme.shp")) {
  download.file("http://geo.vliz.be/geoserver/wfs?request=getfeature&service=wfs&version=1.0.0&typename=MarineRegions:worldheritagemarineprogramme&outputformat=SHAPE-ZIP", "shape.zip")
  unzip("shape.zip", exdir = "shape")
}

shapes <- st_read("shape/worldheritagemarineprogramme.shp") %>%
  select(full_name, country, geometry) %>%
  mutate(full_name = iconv(full_name, "latin1", "UTF-8"))
## Reading layer `worldheritagemarineprogramme' from data source `/Users/pieter/Desktop/notebook-mwhs/shape/worldheritagemarineprogramme.shp' using driver `ESRI Shapefile'
## Simple feature collection with 129 features and 15 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: -180 ymin: -55.00039 xmax: 180 ymax: 71.80583
## geographic CRS: WGS 84

Let’s create a map.

library(mapview)
mapviewOptions(fgb = FALSE)

mapview(shapes)@map

Process spatial data

library(concaveman)
library(sfheaders)

shapes_processed <- shapes %>%
  mutate(geometry = sf_remove_holes(geometry)) %>%
  group_by(full_name) %>%
  summarize(geometry = st_union(geometry))

mapview(shapes, color = "red", lwd = 0.5, alpha = 1, alpha.regions = 0) +
  mapview(shapes_processed, color = "green", lwd = 0.5, alpha = 1, alpha.regions = 0, legend = FALSE)

Fetch occurrence data

Here I’m fetching data from OBIS by area. OBIS is queried by bounding box, but a point-in-polygon calculation is used to discard points outside the areas.

library(purrr)

occ_for_geom <- function(geom) {
  wkt <- st_as_text(st_as_sfc(st_bbox(geom)), digits = 6)
  message(wkt)
  occ <- occurrence(geometry = wkt, fields = c("scientificName", "species", "family", "order", "class", "superclass", "phylum", "decimalLongitude", "decimalLatitude", "date_year", "category", "dataset_id")) %>%
    st_as_sf(coords = c("decimalLongitude", "decimalLatitude"), crs = 4326)
  occ_filtered <- occ %>%
    filter(st_intersects(geometry, geom, sparse = FALSE)) %>%
    as_tibble() %>%
    select(-geometry)
  return(occ_filtered)
}

if (!file.exists("occurrence.Rdata")) {
  occs <- map(shapes_processed$geometry, occ_for_geom)
  for (i in 1:nrow(shapes_processed)) {
    occs[[i]]$full_name <- shapes_processed$full_name[i]
  }
  occ <- bind_rows(occs)

  occ <- occ %>%
    mutate(species_fish = ifelse(superclass == "Pisces", species, NA)) %>%
    mutate(species_vulnerable = ifelse(category %in% c("VU", "EN", "CR"), species, NA)) %>%
    mutate(species_vulnerable_fish = ifelse(superclass == "Pisces" & category %in% c("VU", "EN", "CR"), species, NA))

  save(occ, file = "occurrence.Rdata")
} else {
  load("occurrence.Rdata")
}

Calculate statistics

occ %>%
  filter(!is.na(species)) %>%
  summarize(
    records = n(),
    species = length(unique(species)),
    fish = length(unique(species_fish)),
    vulnerable = length(unique(species_vulnerable)),
    vulnerable_fish = length(unique(species_vulnerable_fish))
  ) %>%
  kable(format.args = list(big.mark = ","))
records species fish vulnerable vulnerable_fish
2,788,079 27,569 6,210 427 236
occ %>%
  filter(!is.na(species)) %>%
  group_by(full_name) %>%
  summarize(
    records = n(),
    species = length(unique(species)),
    fish = length(unique(species_fish)),
    vulnerables = length(unique(species_vulnerable)),
    vulnerable_fish = length(unique(species_vulnerable_fish))
  ) %>%
  kable(format.args = list(big.mark = ","))
full_name records species fish vulnerables vulnerable_fish
Aldabra Atoll 3,429 1,159 503 65 7
Area de Conservación Guanacaste 932 310 307 8 6
Banc d’Arguin National Park 112 40 22 4 3
Belize Barrier Reef Reserve System 8,391 1,077 350 29 23
Brazilian Atlantic Islands: Fernando de Noronha and Atol das Rocas Reserves 945 273 123 9 8
Cocos Island National Park 2,317 499 414 43 42
Coiba National Park and its Special Zone of Marine Protection 2,399 492 450 23 22
East Rennell 13 5 2 1 1
Everglades National Park 59,438 844 230 16 11
Galápagos Islands 57,486 1,540 731 71 57
Gough and Inaccessible Islands 2,486 196 46 10 4
Great Barrier Reef 1,247,815 13,728 2,822 200 77
Gulf of Porto: Calanche of Piana, Gulf of Girolata, Scandola Reserve 38 8 2 2 1
Ha Long Bay 2,009 322 320 7 7
Heard and McDonald Islands 38,584 269 26 9 1
High Coast / Kvarken Archipelago 31,605 278 18 2 2
Ibiza, Biodiversity and Culture 92 39 10 3 2
iSimangaliso Wetland Park 14,887 2,165 955 65 51
Islands and Protected Areas of the Gulf of California 10,652 801 615 40 30
Kluane / Wrangell-St Elias / Glacier Bay / Tatshenshini-Alsek 1,126 98 71 4 1
Komodo National Park 766 402 216 8 7
Lagoons of New Caledonia: Reef Diversity and Associated Ecosystems 31,711 4,679 888 35 12
Macquarie Island 239,068 663 90 12 1
Malpelo Fauna and Flora Sanctuary 15,615 1,001 519 53 46
Natural System of Wrangel Island Reserve 156 57 11 3 1
New Zealand Sub-Antarctic Islands 15,142 1,390 122 25 10
Ningaloo Coast 255,510 3,485 928 92 41
Ogasawara Islands 228 147 121 4 4
Papahanaumokuakea 304,473 2,009 577 32 12
Península Valdés 2,939 200 5 2 1
Phoenix Islands Protected Area 2,618 498 369 9 5
Puerto-Princesa Subterranean River National Park 116 102 28 2 2
Rock Islands Southern Lagoon 4,740 888 675 19 13
Shark Bay, Western Australia 9,918 1,349 532 38 14
Shiretoko 258 51 41 2 1
Sian Ka’an 443 111 75 5 3
Socotra Archipelago 4,320 541 65 20 2
St Kilda 3,301 119 17 5 2
Surtsey 4 3 1 1 1
The Wadden Sea 410,953 1,257 99 12 10
Tubbataha Reefs Natural Park 165 31 9 8 4
Ujung Kulon National Park 186 42 2 8 1
West Norwegian Fjords ? Geirangerfjord and Nærøyfjord 10 6 1 1 1
Whale Sanctuary of El Vizcaino 683 114 108 10 10

Fish DNA barcodes in molecular databases

[todo]